Repository navigation
fix(id): validate shell contract top-level fields at load (#4323) - #6172
Merged
Merged
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Member
Author
|
🤖 Agent note · duplicate salvage check (protocol §8)
|
This was referenced Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
parseShellContractvalidated only per-frame field specs; the top-level fields the checks read (max_frame_bytes,routing_fields,projection.redacted_keys) were never validated, although the RustRawContractrequires all of them. A malformed contract was accepted at load and later threw aTypeErrorat check time (missingrouting_fields/projection) or silently disabled a check (missingmax_frame_bytesturns off the frame cap; a stringrouting_fieldssubstring-matches field names).Change
pkgs/id/web/src/shell-contract.ts:parseShellContractnow rejects, with a named load-time error:max_frame_bytesmissing / non-integer / negative —max_frame_bytes must be a non-negative integerrouting_fieldsmissing / not an array of strings —routing_fields must be an array of stringsprojectionmissing / not an object —projection must be an objectprojection.redacted_keysmissing / not an array of strings —projection.redacted_keys must be an array of stringspkgs/id/web/src/world-contract.test.ts: regression test covering each malformed variant (missing routing_fields, string routing_fields, mixed routing_fields, missing/string projection, missing/mixed redacted_keys, missing/negative/fractional max_frame_bytes).Verification
vitest run src/world-contract.test.ts— 24/24 pass, including the existing conformance tests against the realcontract/shell-contract.v1.jsontsc --noEmit— cleanFixes #4323. Queue task 6193.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.